<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<title>处理结果保存</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/comm.js" type="text/javascript"></script>
<script>
$(function () {
	$('#feed-form').submit(function () {
		JYCsm.form.ajaxPost({
			formSelector: '#feed-form',
			dlgId: 'feed-form-dlg',
			action: 'index.php?c=feed&a=saveFeedJson'
		});
		return false;
	});
});
</script>
</head>

<body>
	<div class="msgBox">
    	<h2>评价反馈</h2>
        <div class="bc">
<table class="tableForm" width="350px" border="0">
	<tr>
		<td align="left" style="font-size: 14px; font-weight: bold;">科室：
		<select name='deptype' class="select">
			<option value="1" <?php if($deptype == 1)echo ' selected ';?>>门诊科室</option>
			<option value="2" <?php if($deptype == 2)echo ' selected ';?>>住院科室</option>
		</select>
			<select class="select deptype" deptype='1' name="" style='display:none;'>
		<?php 
			$allmzdep = JYDep::getMzDepts(CSM_UNIT_ID);
				if(is_array($allmzdep) && count($allmzdep)>0){
					foreach ($allmzdep as $k=>$v){
		?>
			<option value="<?php echo $v['DEP_NO'];?>" <?php if($depid == $v['DEP_NO'])echo 'selected'?>><?php echo $v['DEP_NAME'];?></option>
		<?php 
				}
			}
		?>
			</select>
			<select class="select deptype" deptype='2' name="depid">
			<?php 
				$allzydep = JYDep::getZyDepts(CSM_UNIT_ID);
				if(is_array($allzydep) && count($allzydep)>0){
					foreach ($allzydep as $k=>$v){
			?>
				<option value="<?php echo $v['DEP_NO'];?>" <?php if($depid == $v['DEP_NO'])echo 'selected'?>><?php echo $v['DEP_NAME'];?></option>
			<?php 
					}
				}
			?>
			</select>	
		</td>
	</tr>
	<tr>
		<th style="vertical-align: top;text-align: left;">内容：</th>
	</tr><tr>
		<td><textarea class="textarea" name="content" cols="2" rows="10" style="width: 510px;"></textarea></td>
	</tr>
	<tr>
		<td>
			<input class="btn_gray" name="sub_ask" typeid='3' type="submit" value="表扬" />
			<input class="btn_gray" name="sub_ask" typeid='2' type="submit" value="建议" />
			<input class="btn_gray" name="sub_ask" typeid='1' type="submit" value="投诉" />
			<input class="btn_gray" name="sub_ask" typeid='4' type="submit" value="意见" />
			<input class="btn_gray" name="sub_ask" typeid='5' type="submit" value="其它" />
			<span class='msg red' id='msg'><?php echo $msg;?></span>
		</td>
	</tr>
</table>
</div>
    </div>
</body>
</html>
<script src="/js/boot.js"></script>
<script src="/js/tip.js"></script>
<script type='text/javascript'>
$('select[name="deptype"]').change(function (){
	var type = $(this).val()
	$('select.deptype').each(function(){
		$(this).attr('name','');
		$(this).hide();
		if(type == $(this).attr('deptype')){
			$(this).attr('name','depid');
			$(this).show();
		}
	})
})
$('input[name="sub_ask"]').click(function(){
	var depid = $('select[name="depid"]').val()
	var type = $(this).attr('typeid')
	var con = $('textarea[name="content"]').val()
	var deptype = $('select[name="deptype"]').val()
	var t = this
	if(t.cursor == 'wait'){return false}
	t.cursor = 'wait';
	if(con == ''){
		$('#msg').html('咨询内容不能为空')
		t.cursor = 'pointer'
		return false;
	}
	$.ajax({
		url:'<?php echo $_SERVER['REQUEST_URI']?>',
		data:{'depid':depid,'type':type,'content':con,'deptype':deptype},
		type:'post',
		dataType:'json',
		success:(function(de){
			if(de.code > 0){
				var c = $(window.parent.document.body)
				$(c).find('.aui_state_focus').hide();
				JYCsm.messager.succ(de.msg);
				JYCsm.closeWindow('feed-form-dlg');
			} else if (de.code) {
				JYCsm.messager.error(de.msg);
			}
			//$('#msg').html(lang[de.msg])
			t.cursor='pointer'
		})
	})
})
</script>